package cc.eddic.pratice.programmingparadigms.emp02list;

import cc.eddic.pratice.programmingparadigms.*;

public interface EmployeeList {
    void add(Employee employee);

    Employee get(int index);

    int size();

    default Employee find(EmployeePredicate predicate) {
        for (int i = 0; i < size(); ++i) {
            Employee r = get(i);
            if (predicate.test(r)) {
                return r;
            }
        }
        return null;
    }

    default void sort(EmployeeComparator comparator) {

    }
}
